<template>
    <el-dialog close-on-press-escape draggable :close-on-click-modal="false" :modal="true" align-center destroy-on-close
        v-model="store.dialog.model.show" :title="store.dialog.model.windowTitle" width="800" style="height: auto;">
        <div style="width: 100%;height: max-content;overflow-y: auto;max-height: calc(100vh - 600px);">
            <div style="margin-top: 10px;white-space: pre-wrap;line-height: 1.5;font-size: 16px;">{{ store.dialog.model.title }}</div>
        </div>

        <div style="text-align: right;margin-top: 10px;" slot="footer" class="dialog-footer">
            <el-button v-if="store.dialog.model.showCancel" @click="async () => {
                await tool.flow(async () => {
                    store.dialog.model.cancelCallBack()
                }, (err) => {
                    tool.toast.error(`${err}`)
                })
                store.hideModal()
            }">取消</el-button>
            <el-button type="primary" @click="async () => {
                await tool.flow(async () => {
                    store.dialog.model.okCallBack()
                    store.hideModal()
                }, (err) => {
                    tool.toast.error(`${err}`)
                })
            }">确定</el-button>
        </div>
    </el-dialog>
</template>

<script setup>
import { ref, reactive, defineProps, computed, watch, onMounted, onBeforeUnmount } from 'vue';
import { useStore } from '../modules/store'
const store = useStore()
import tool from '../modules/tool'

onMounted(async () => {

})
</script>

<style scoped></style>